-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Documentation: add asset generation using dependency graph doc #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation: add asset generation using dependency graph doc #105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this paragraph is sounding a lot like Make, Bazel, Terraform, etc. ;)
mini version of these :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The asset is an map of all the assets...
This reads a bit awkwardly (one asset containing many?). Maybe just drop this last sentence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a Merkle DAGs. Maybe our state structure should just be a DAG? That would build dependencies into the structure directly. I'm sure there are many off-the-shelf Merkle DAG libraries in Go (here's one), but rolling our own for this special case will probably not be hard either. Something like:
type State struct {
Objects map[string]Asset // store for all the assets
Root string // hash for the root asset
}
type Asset struct {
Parents []string // hashes for our parents
Name string
Path string // is this really important? I'd have expected we can just use `Name` for this.
Data []byte
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect []byte for this.
2546430 to
86503b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we decided that we gonna just throw our hands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's still an valid outcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the parent include everything but the final targets ?
I would expect some tree-list structure, besides how is this struct related to the Assets struct below?
I was thinking something like:
type State struct {
Assets []Asset; // Final leaf assets
}
type Asset struct {
Name string
Parents []Asset
Dirty bool
Hash string
Data []byte
...
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The state object is an hashmap containing all the assets, not just the final. Each asset will use this object to fetch its dependencies.
|
@abhinavdahiya The description lgtm, but I have questions on the type definition. |
|
Discussed with @abhinavdahiya , agree on the definition of the struct in this doc, just waiting on some fix of the naming. |
86503b4 to
8ca6932
Compare
yifan-gu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, yifan-gu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
|
||
| // AssetState is the state of an Asset. | ||
| type AssetState struct { | ||
| Parents maps[string]string // hashes for our each parent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attempt to remove warnings for "unused" TF variables
No description provided.